import {
  createStore
} from 'vuex'
import axios from 'axios'
import persist from 'vuex-persistedstate'
export default createStore({
  state: {
    objList: []
  },
  mutations: {
    pushObj(state, value) {
      state.objList = value
    }
  },
  actions: {
    getObj(state) {
      axios.get('data.json').then(res => {
        state.commit('pushObj', res)
      })
    }

  },
  plugins: [persist()]
})